Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv4 prefixes shouldn't be sent by default over IPv6 session with FRR. #905

Merged
merged 1 commit into from
Aug 23, 2017

Conversation

nikos-github
Copy link
Collaborator

When a bgp ipv6 session is established with frr, ipv4 prefixes are sent over it by default. This is an
unsupported scenario and also causes double the processing and memory util.

Fixing this by making sure ipv4 AF is not enabled by default and explicitly activating the ipv4 nbrs
under AF ipv4 unicast.

Nikos.-

RB=
G=lnos-reviewers
R=ntrianta,rjonnadu,rmolina,sfardeen,zxu
A=
@msftclas
Copy link

@Nikos-Li,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@lguohan
Copy link
Collaborator

lguohan commented Aug 22, 2017

does this apply to quagga as well?

@nikos-github
Copy link
Collaborator Author

@lguohan Yes it applies to quagga as well but I wasn't sure if you were using IPv6 or if you want
this because it does add to the config. I tested the fix in quagga as well so let me know if you want
the change in quagga and I'll make it.

@nikos-github
Copy link
Collaborator Author

nikos-github commented Aug 22, 2017

Before the fix:

lnos-x1-a-asw01# show bgp ipv4 unicast      
BGP table version is 5034, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path

*  175.0.0.0/24     10.1.1.1                               0 10 12 112 i
*=                  10.2.1.1                               0 20 12 112 i
*                   10.4.1.1                               0 40 12 112 i
*                   10.3.1.1                               0 30 12 112 i
*                   10.2.1.1                               0 20 12 112 i
*=                  10.1.1.1                               0 10 12 112 i
*=                  10.4.1.1                               0 40 12 112 i
*>                  10.3.1.1                               0 30 12 112 i

lnos-x1-a-asw01# show bgp ipv4 unicast 175.0.0.0/24
BGP routing table entry for 175.0.0.0/24
Paths: (8 available, best #8, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.1.1 10.2.1.1 10.3.1.1 10.4.1.1 11.1.1.1 fc00:1:1::1 fc00:2:1::1 fc00:3:1:
:1 fc00:4:1::1
  10 12 112
    10.1.1.1 from fc00:1:1::1 (1.1.1.1)
      Origin IGP, localpref 100, valid, external
      AddPath ID: RX 0, TX 15143
      Last update: Mon Aug 21 19:10:20 2017

  20 12 112
    10.2.1.1 from 10.2.1.1 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, multipath
      AddPath ID: RX 0, TX 14143
      Last update: Mon Aug 21 19:10:20 2017

  40 12 112
    10.4.1.1 from fc00:4:1::1 (4.4.4.4)
      Origin IGP, localpref 100, valid, external
      AddPath ID: RX 0, TX 13125
      Last update: Mon Aug 21 19:10:19 2017
lnos-x1-a-asw01# show bgp ipv4 unicast neighbors fc00:1:1::1 
  advertised-routes  Display the routes advertised to a BGP neighbor
  dampened-routes    Display the dampened routes received from neighbor
  flap-statistics    Display flap statistics of the routes learned from neighbor
  prefix-counts      Display detailed prefix count information
  received           Display information received from a BGP neighbor
  received-routes    Display the received routes from neighbor
  routes             Display routes learned from neighbor
lnos-x1-a-asw01# show bgp neighbors fc00:1:1::1              
BGP neighbor is fc00:1:1::1, remote AS 10, local AS 11, external link
 Description: CSW01
  BGP version 4, remote router ID 1.1.1.1
  BGP state = Established, up for 00:03:36
  Last read 00:00:36, Last write 00:00:36
  Hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    AddPath:
      IPv4 Unicast: RX advertised IPv4 Unicast
      IPv6 Unicast: RX advertised IPv6 Unicast
    Route refresh: advertised and received(old & new)
    Address Family IPv4 Unicast: advertised and received
    Address Family IPv6 Unicast: advertised and received
    Hostname Capability: advertised
    Graceful Restart Capabilty: advertised and received
      Remote Restart timer is 120 seconds
      Address families by peer:
        none
  Graceful restart informations:
    End-of-RIB send: IPv4 Unicast, IPv6 Unicast
    End-of-RIB received: IPv4 Unicast, IPv6 Unicast
  Message statistics:
    Inq depth is 0
    Outq depth is 0

After the fix:

router bgp 11
 bgp router-id 11.11.11.11
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 bgp bestpath as-path multipath-relax
 neighbor 10.1.1.1 remote-as 10
 neighbor 10.1.1.1 description CSW01
 neighbor 10.2.1.1 remote-as 20
 neighbor 10.2.1.1 description CSW02
 neighbor 10.3.1.1 remote-as 30
 neighbor 10.3.1.1 description CSW03
 neighbor 10.4.1.1 remote-as 40
 neighbor 10.4.1.1 description CSW04
 neighbor 11.1.1.1 remote-as 111
 neighbor 11.1.1.1 description IXIA
 neighbor fc00:1:1::1 remote-as 10
 neighbor fc00:1:1::1 description CSW01
 neighbor fc00:2:1::1 remote-as 20
 neighbor fc00:2:1::1 description CSW02
 neighbor fc00:3:1::1 remote-as 30
 neighbor fc00:3:1::1 description CSW03
 neighbor fc00:4:1::1 remote-as 40
 neighbor fc00:4:1::1 description CSW04
 !
 address-family ipv4 unicast
  network 11.11.11.11/32
  network 100.100.100.0/24
  neighbor 10.1.1.1 activate
  neighbor 10.2.1.1 activate
  neighbor 10.3.1.1 activate
  neighbor 10.4.1.1 activate
  neighbor 11.1.1.1 activate
  maximum-paths 64
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8:bad:a55::/64
  neighbor fc00:1:1::1 activate
  neighbor fc00:2:1::1 activate
  neighbor fc00:3:1::1 activate
  neighbor fc00:4:1::1 activate
  maximum-paths 64
 exit-address-family

lnos-x1-a-asw01# show bgp ipv4 uni
BGP table version is 1009, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*= 175.0.0.0/24     10.4.1.1                               0 40 12 112 i
*=                  10.2.1.1                               0 20 12 112 i
*=                  10.3.1.1                               0 30 12 112 i
*>                  10.1.1.1                               0 10 12 112 i
lnos-x1-a-asw01# show bgp ipv4 uni 175.0.0.0/24
BGP routing table entry for 175.0.0.0/24
Paths: (4 available, best #4, table Default-IP-Routing-Table)
  Advertised to non peer-group peers:
  10.1.1.1 10.2.1.1 10.3.1.1 10.4.1.1 11.1.1.1
  40 12 112
    10.4.1.1 from 10.4.1.1 (4.4.4.4)
      Origin IGP, localpref 100, valid, external, multipath
      AddPath ID: RX 0, TX 3044
      Last update: Tue Aug 22 00:05:53 2017

  20 12 112
    10.2.1.1 from 10.2.1.1 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, multipath
      AddPath ID: RX 0, TX 2029
      Last update: Tue Aug 22 00:05:53 2017

  30 12 112
    10.3.1.1 from 10.3.1.1 (3.3.3.3)
      Origin IGP, localpref 100, valid, external, multipath
      AddPath ID: RX 0, TX 1029
      Last update: Tue Aug 22 00:05:53 2017

  10 12 112
    10.1.1.1 from 10.1.1.1 (1.1.1.1)
      Origin IGP, localpref 100, valid, external, multipath, best
      AddPath ID: RX 0, TX 17
      Last update: Tue Aug 22 00:05:53 2017
lnos-x1-a-asw01# show bgp neigh fc00:1:1::1
BGP neighbor is fc00:1:1::1, remote AS 10, local AS 11, external link
 Description: CSW01
  BGP version 4, remote router ID 1.1.1.1
  BGP state = Established, up for 22:31:15
  Last read 00:00:15, Last write 00:00:15
  Hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    AddPath:
      IPv6 Unicast: RX advertised IPv6 Unicast
    Route refresh: advertised and received(old & new)
    Address Family IPv4 Unicast: received
    Address Family IPv6 Unicast: advertised and received
    Hostname Capability: advertised
    Graceful Restart Capabilty: advertised and received
      Remote Restart timer is 120 seconds
      Address families by peer:
        none
  Graceful restart informations:
    End-of-RIB send: IPv6 Unicast
    End-of-RIB received: IPv6 Unicast

@stcheng
Copy link
Contributor

stcheng commented Aug 22, 2017

why this is closed?

@nikos-github nikos-github reopened this Aug 23, 2017
@msftclas
Copy link

@Nikos-Li,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@lguohan lguohan merged commit 34377f2 into sonic-net:master Aug 23, 2017
@lguohan
Copy link
Collaborator

lguohan commented Aug 23, 2017

I tested quagga in the T0 testbed. Between T0 and T1, there are both bgp v4 and v6 sessions. However, I do not see v4 routes advertised via v6 session from T1. T1 is arista device, T0 is sonic device with quagga.

ARISTA01T1>show ipv6 bgp nei fc00::71 received-routes 
BGP routing table information for VRF default
Router identifier 100.1.0.29, local AS number 64600
Route status codes: s - suppressed, * - valid, > - active, # - not installed, E - ECMP head, e - ECMP
                    S - Stale, c - Contributing to ECMP, b - backup
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop

        Network             Next Hop         Metric  LocPref Weight Path
 * >    fc00:1::32/128      fc00::71         0       100     -      65100 i  
ARISTA01T1>


ARISTA01T1>show ip bgp nei 10.0.0.56 received-routes            
BGP routing table information for VRF default
Router identifier 100.1.0.29, local AS number 64600
Route status codes: s - suppressed, * - valid, > - active, # - not installed, E - ECMP head, e - ECMP
                    S - Stale, c - Contributing to ECMP, b - backup
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop

        Network             Next Hop         Metric  LocPref Weight Path
 * >    10.1.0.32/32        10.0.0.56        0       100     -      65100 i  
 * >    192.168.0.0/27      10.0.0.56        0       100     -      65100 i 

configuration on t0

 bgp router-id 10.1.0.32
 bgp log-neighbor-changes
 bgp graceful-restart
 bgp bestpath as-path multipath-relax
 network 10.1.0.32/32
 network 192.168.0.0/27
 neighbor 10.0.0.57 remote-as 64600
 neighbor 10.0.0.57 description ARISTA01T1
 neighbor 10.0.0.57 allowas-in 1
 neighbor 10.0.0.59 remote-as 64600
 neighbor 10.0.0.59 description ARISTA02T1
 neighbor 10.0.0.59 allowas-in 1
 neighbor 10.0.0.61 remote-as 64600
 neighbor 10.0.0.61 description ARISTA03T1
 neighbor 10.0.0.61 allowas-in 1
 neighbor 10.0.0.63 remote-as 64600
 neighbor 10.0.0.63 description ARISTA04T1
 neighbor 10.0.0.63 allowas-in 1
 neighbor fc00::72 remote-as 64600
 neighbor fc00::72 description ARISTA01T1
 neighbor fc00::76 remote-as 64600
 neighbor fc00::76 description ARISTA02T1
 neighbor fc00::7a remote-as 64600
 neighbor fc00::7a description ARISTA03T1
 neighbor fc00::7e remote-as 64600
 neighbor fc00::7e description ARISTA04T1
 maximum-paths 64
!
 address-family ipv6
 network fc00:1::32/128
 neighbor fc00::72 activate
 neighbor fc00::72 allowas-in 1
 neighbor fc00::76 activate
 neighbor fc00::76 allowas-in 1
 neighbor fc00::7a activate
 neighbor fc00::7a allowas-in 1
 neighbor fc00::7e activate
 neighbor fc00::7e allowas-in 1
 maximum-paths 64
 exit-address-family

On arista T1,

ARISTA01T1>show ipv6 bgp nei
BGP neighbor is fc00::71, remote AS 65100, external link
  Description: 65100
  BGP version 4, remote router ID 10.1.0.32, VRF default
  Negotiated BGP version 4
  Last read 00:00:50, last write 00:00:50
  Hold time is 180, keepalive interval is 60 seconds
  Configured hold time is 180, keepalive interval is 60 seconds
  Connect timer is inactive
  Idle-restart timer is inactive
  BGP state is Established, up for 00:01:50
  Number of transitions to established: 328
  Last state was OpenConfirm
  Last event was RecvKeepAlive
  Last sent notification:Cease/other configuration change, Last time 11:12:47, First time    6d06h, Repeats 19
  Last rcvd notification:Cease/peer de-configured, Last time 00:01:53, First time 00:20:19, Repeats 2
  Last sent socket-error:Network is unreachable, Last time    3d04h, First time    8d05h, Repeats 4
  Last rcvd socket-error:received unexpected EOF, Last time 00:06:34
  Neighbor Capabilities:
    Multiprotocol IPv4 Unicast: received
    Multiprotocol IPv6 Unicast: advertised and received and negotiated
    Graceful Restart IPv6 Unicast: received
    Four Octet ASN: advertised and received
    Route Refresh: advertised and received and negotiated
    Send End-of-RIB messages: advertised and received and negotiated
    Additional-paths Receive:
      IPv6 Unicast: advertised
    Graceful Restart received:
       Restart-time is 120
       Restarting: yes
       IPv4 Unicast is enabled, Forwarding State is not preserved [forwarding bit: 0]
       IPv6 Unicast is enabled, Forwarding State is not preserved [forwarding bit: 0]
  Restart timer is inactive
  End of rib timer is inactive
  Message statistics:
    InQ depth is 0
    OutQ depth is 0
                         Sent      Rcvd
    Opens:               2710      1845
    Notifications:        814      1054
    Updates:          1051212    825567
    Keepalives:        111220    110119
    Route-Refresh:          0         0
    Total messages:   1165956    938585

@nikos-github
Copy link
Collaborator Author

Notice the arista output for show ipv6 bgp neigh - this is the issue:

Neighbor Capabilities:
Multiprotocol IPv4 Unicast: received

Sonic with quagga/frr will advertise by default the IPv4 unicast capability over the ipv6 neighbor.

If you peer sonic with sonic, which is what we are having, the issue will appear.

You don't see the problem with a cisco or an arista device at the other end because the IPv4 unicast
capability is not advertised by default.

@lguohan
Copy link
Collaborator

lguohan commented Aug 23, 2017

I see, so that happens to quagga to quagga bgp peering.

do you know what happens to the passive peer group as sonic has a peer-group defined here. https://github.com/Azure/sonic-buildimage/blob/master/dockers/docker-fpm-quagga/bgpd.conf.j2#L84

For this peer-group, we do like to support ipv4.

@sihuihan88 for the conversation.

@nikos-github
Copy link
Collaborator Author

This is orthogonal to peer-groups. If you enable ipv6 and you peer sonic to sonic, you will have
the problem unless you make sure the ipv4 unicast af capability isn't advertised from both sides
by default.

zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Oct 17, 2019
* msft_github/master:
  [snmpagent]: Update sonic-snmpagent submodule (sonic-net#1004)
  [swss]: Update the ipinip.j2 template to specify the IPv4 loopback address (sonic-net#998)
  Change all port_config.ini column headers from 'port' to 'index' (sonic-net#1001)
  [docker-platform-monitor]: Remove stale fancontrol.pid file (if exists) before starting fancontrol (sonic-net#1002)
  [swss]: Update swss/common submodules (sonic-net#988)
  [snmp]: Update py-swsssdk/snmpagent submodules (sonic-net#996)
  [Broadcom]: Update SAI version to 3.0.3.2-5 (sonic-net#997)
  [Mellanox]: Update outdated MSN2410 minigraph (sonic-net#995)
  Add time stamp suffix to the dirty images version string (sonic-net#958)
  [Mellanox]: Remove FW upgrade procedure in docker (sonic-net#989)
  [snmp]: Update sonic-snmpagent submodule (sonic-net#986)
  [Broadcom]: Update SAI version to 3.0.3.2-4 (sonic-net#983)
  [Ingrasys]: Add Ingrasys S8900-64XC sfputil function and update submodule (sonic-net#984)
  [mellanox]: Update Mellanox SAI version (sonic-net#979)
  [Ingrasys]: Change hwmon kernel modules installation order (sonic-net#980)
  [Makefile] Allowing interactive session with the slave docker-container (sonic-net#903)
  [snmp]: Update sonic-snmpagent submodule (sonic-net#978)
  Disable snmpd module disk_hw, so no syslog messages about unavailable disks (sonic-net#977)
  [teamd]: Remove deprecated blocking logic before starting teamd (sonic-net#976)
  [Broadcom]: Update libsai version to 3.0.3.2-2 (sonic-net#973)
  [device/accton]: Add a new supported device, AS7312-54X (sonic-net#955)
  [sairedis]: update sairedis submodule (sonic-net#974)
  lacp runner will send lacp update right after it received SIGINT (sonic-net#969)
  [config]: Fix management interface configuration (sonic-net#966)
  [Broadcom]: Update OpenNSL modules (sonic-net#970)
  [utilities]: Update sonic-utilities (sonic-net#968)
  [interfaces]: Change MTU value to 9100  (sonic-net#967)
  Framework to plugin Organization specific scripts during ONIE Image build  (sonic-net#951)
  Always start with Forwarding State flag set for bgpd (sonic-net#963)
  Update sonic-utilities to be compatible with sonic-net#942 (sonic-net#965)
  [swss]: Fix the command to get HWSKU with sonic-cfggen (sonic-net#964)
  [bgp]: Fix the deployment_id with DEVICE_METADATA (sonic-net#962)
  [Ingrasys] Update Ingrasys submodule for S8900-54XC (sonic-net#954)
  [build/onie installer] Install grub for SONiC post migration from another NOS (sonic-net#949)
  [syncd]: Comment out unused docker-ptf-brcm.mk
  [Broadcom]: Update OpenNSL/SAI version (sonic-net#959)
  [swss]: Move swss/common/sairedis submodule to 201709 tag
  [sairedis]: update sairedis submodule head (sonic-net#956)
  [service template] Starting new docker when HWSKU change is detected (sonic-net#946)
  [config] Fix an issue that bgp asn data type is not consistent (sonic-net#953)
  [mellanox]: Update Mellanox SAI version ansd SDK version
  [Ingrasys] update port_config.ini and sfputil for ingrasys platforms (sonic-net#952)
  [frr]: RR client support in minigraph for FRR (sonic-net#923)
  [configdb] Migrate minigraph configurations to DB (sonic-net#942)
  [devices]: Add led plugin for Arista 7060CX-32S and 7260CX3-64 (sonic-net#945)
  [sonic-slave]: SLAVE_TAG should be for both Dockerfile and Dockerfile.user (sonic-net#950)
  [github]: add templates for submitting issues and PR (sonic-net#947)
  [rsyslog]: Use timegenerated instead of timestamp (sonic-net#944)
  [dell]: remove nos_to_sonic_grub.cfg (sonic-net#943)
  [slave.mk]: Apply series of patches to SONIC_PYTHON_STDEB_DEBS targets if they exist (sonic-net#941)
  [rsyslog]: Use SONiC template in containers (sonic-net#940)
  [Broadcom]: Remove BRCM_OPENNSL library and upgrade BRCM_SAI to 3.0.3.2 (sonic-net#938)
  [baseimage]: allocate varlog disk in the initramfs stage (sonic-net#936)
  [sairedis]: revert deadlock fix in sonic-sairedis submodule (sonic-net#934)
  Replace CRLF line endings with LF (sonic-net#932)
  Fix confusing comment (sonic-net#931)
  Update sfputil support for Ingrasys S9100 (sonic-net#929)
  [quagga]: Disable ipv4 over ipv6 and enable ipv6 over ipv4 peer group (sonic-net#922)
  [quagga] enable core dump for bgpd and zebra (sonic-net#927)
  [devices]: Update Dell s6100/z9100 platform modules (sonic-net#925)
  Revert "Migrate DEVICE_METADATA to db (sonic-net#919)" (sonic-net#928)
  Migrate DEVICE_METADATA to db (sonic-net#919)
  [devices]: Bump sonic-platform-modules-arista submodule (sonic-net#924)
  [image]: build sonic-broadcom.raw image for sonic conversion from ftos (sonic-net#901)
  [sonic-slave] Force pyangbind version to 0.5.10 (sonic-net#918)
  [Arista-7260CX3] Rename hwSKU Arista-7260CX3-64 to Arista-7260CX3-C64, introducing new hwSKU Arista-7260CX3-D108C8 (sonic-net#920)
  [devices]: modify sfputil plugins for mellanox devices for new platform API (sonic-net#916)
  [cavm]Update sai revision and packet driver (sonic-net#914)
  [translate-acl] Specify pyangbind version to not introduce new dependency (sonic-net#915)
  Update sfputil support for Arista platforms (sonic-net#912)
  Port speed (sonic-net#879)
  [Accton]: Add a new supported device AS5712-54X (sonic-net#898)
  [kernel]: update kernel submodule (sonic-net#910)
  [device]: Updated dell s6100 submodule to 5ab014 (sonic-net#909)
  [broadcom]: update broadcom sai package to 2.1.5.1-17 (sonic-net#908)
  IPv4 prefixes shouldn't be sent by default over IPv6 session with FRR. (sonic-net#905)
  [submodule]: update sonic linux kernel (sonic-net#906)
  [sonic-sairedis] update sairedis submodule (sonic-net#211, sonic-net#212) (sonic-net#904)
  [mlnx-fw-upgrade]: Define required FW version in build time. (sonic-net#902)
  [SAI]: Remove the SAI submodule from buildimage repo (sonic-net#893)
  [Submodule update]: sonic-utilities (sonic-net#888)
  Revert "[mellanox]: Update Mellanox SAI version"
  [mellanox]: Update Mellanox SAI version
  [utilities]: Update sonic-utilities submodule
  [swss-common]: Update sonic-swss-common submodule
  [mellanox]: Disable fsat boot mode for SX kernel
  [quagga]: Update sonic-quagga submodule
  [Broadcom]: Update Broadcom SAI/SDK version (sonic-net#883)
  Squash merge v1.0.3 branch onto master
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
After switching to FRR, routes cannot be inserted if the
interface is not connected, or 'carrier down'. Thus, it
is mandatory to force the interface carrier up.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants